<template>
  <m-scroll-board
    class="order-list"
    :row-num="5"
    :loading="props.loading"
    :cols="columns"
    :datas="props.list"
    :config="curConfig"
  />
</template>
<script setup>
import http from '@/utils/request'
import moment from 'moment'

// props
const props = defineProps({
  loading: Boolean,
  list: {
    type: Array,
    default: () => { return [] }
  }
})

// 变量
const columns = ref([
  // { width: 40, title: '序号', type: 'seq', align: 'center' },
  // { width: 140, title: '工单号', property: 'MO_CODE' },
  { width: 140, title: '排产单号', property: 'SCHE_NO' },
  
  { width: 120, title: '工单量', property: 'PLAN_QTY' },
  { width: 120, title: '完工量', property: 'COMPLETE_QTY' },
  
  { width: 160, title: '物料编码', property: 'MITEM_CODE' },
  { width: 180, title: '物料描述', property: 'MITEM_DESC' },
  { width: 100, title: '状态', property: 'STATUS' },
  { width: 140, title: '完工百分比', property: 'COMPLETE_RATE', formatter: ({ cellValue }) => {
    const v = cellValue || 0
    return (v*100).toFixed(2) + "%"
  } },
])

const curConfig = ref({
  headerBGC: "#222D75", // 标题
  oddRowBGC: "#070750", // 奇数
  evenRowBGC: "#0A2732", // 偶数
})


function init() {}
onMounted(() => {
  init()
})

// 暴露方法
defineExpose({
  init
})
</script>

<style lang="less" scoped>
// ::v-deep(.order-list) {
//   background: red;
//   .dv-scroll-board {
//     background: red;
//     .header {
//       background: red;
//       .hedaer-item {
//         background: red;
//         font-size: 18px!important;
//       }
//     }
//   }
// }
</style>